package com.ruoyi.hospital.service.member.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.member.MemberZanMapper;
import com.ruoyi.hospital.domain.member.MemberZan;
import com.ruoyi.hospital.service.member.IMemberZanService;

/**
 * 点赞记录Service业务层处理
 * 
 * @author wendao
 * @date 2024-12-19
 */
@Service
public class MemberZanServiceImpl implements IMemberZanService 
{
    @Autowired
    private MemberZanMapper memberZanMapper;

    /**
     * 查询点赞记录
     * 
     * @param id 点赞记录主键
     * @return 点赞记录
     */
    @Override
    public MemberZan selectMemberZanById(Integer id)
    {
        return memberZanMapper.selectMemberZanById(id);
    }

    /**
     * 查询点赞记录列表
     * 
     * @param memberZan 点赞记录
     * @return 点赞记录
     */
    @Override
    public List<MemberZan> selectMemberZanList(MemberZan memberZan)
    {
        return memberZanMapper.selectMemberZanList(memberZan);
    }

    /**
     * 新增点赞记录
     * 
     * @param memberZan 点赞记录
     * @return 结果
     */
    @Override
    public int insertMemberZan(MemberZan memberZan)
    {
        memberZan.setCreateTime(DateUtils.getNowTimeSecond());
        return memberZanMapper.insertMemberZan(memberZan);
    }

    /**
     * 修改点赞记录
     * 
     * @param memberZan 点赞记录
     * @return 结果
     */
    @Override
    public int updateMemberZan(MemberZan memberZan)
    {
        memberZan.setUpdateTime(DateUtils.getNowTimeSecond());
        return memberZanMapper.updateMemberZan(memberZan);
    }

    /**
     * 批量删除点赞记录
     * 
     * @param ids 需要删除的点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberZanByIds(Integer[] ids)
    {
        return memberZanMapper.deleteMemberZanByIds(ids);
    }

    @Override
    public int deleteByMemberId(Integer zanId, Integer memberId) {
        return memberZanMapper.deleteByMemberId(zanId,memberId);
    }

    /**
     * 删除点赞记录信息
     * 
     * @param id 点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteMemberZanById(Integer id)
    {
        return memberZanMapper.deleteMemberZanById(id);
    }
}
